import pandas as pd

df1 = pd.DataFrame(
    {"语文": [67, 56, 100],
     "数学": [78, 79, 99],
     "英语": [99, 83, 98]},
    index=["张三", "李四", "王五"]
)

# 如果需要使用 pivot，需要将数据转换为长格式
df_melted = df1.reset_index().melt(
    id_vars='index', var_name='科目', value_name='成绩')
df_pivoted = df_melted.pivot(index='index', columns='科目', values='成绩')
print(df_pivoted)